<?xml version="1.0" encoding="UTF-8" ?>
<jsp:root xmlns:jsp="http://java.sun.com/JSP/Page" xmlns:f="http://java.sun.com/jsf/core" xmlns:h="http://java.sun.com/jsf/html" xmlns:a4j="http://richfaces.org/a4j" xmlns:rich="http://richfaces.org/rich" xmlns:p="http://java.sun.com/jsf/portlet/components" version="2.0">
	<f:view>
		<p:portletPage>
			<a4j:outputPanel layout="block" styleClass="mediadoresWrapper">
				<a4j:outputPanel layout="block" styleClass="headerWrapper">
					<a4j:outputPanel layout="block" styleClass="accesible clearfix"></a4j:outputPanel>
				</a4j:outputPanel>
				<a4j:outputPanel layout="block" styleClass="topMenuWrapper">
					<h:form>
						<a4j:outputPanel>
							<a4j:commandLink value="Volver" action="back" immediate="true" styleClass="topMenuLink" />
						</a4j:outputPanel>
						<a4j:outputPanel>
							<a4j:commandLink value="Nueva promoción" onclick="showMarketingPromotionDetail(0)" styleClass="topMenuLink" />
						</a4j:outputPanel>
					</h:form>
				</a4j:outputPanel>
				<a4j:outputPanel layout="block" styleClass="contentWrapper">
					<a4j:outputPanel layout="block" styleClass="titleWrapper">
						<h:outputText value="Gestión de promociones comerciales" />
					</a4j:outputPanel>
					<rich:panel>
						<h:form>
							<rich:datascroller id="marketingPromotionsDataScroller" for="marketingPromotionsDataTable" />
							<br />
							<rich:dataTable id="marketingPromotionsDataTable" value="#{MarketingPromotionsManagement.tableDataModel}" var="item" rows="10" onRowDblClick="showMarketingPromotionDetail(#{item.internalID})" columnClasses="minWidthColumn noWrapColumn rightAlignText,maxWidthColumn noWrapColumn,minWidthColumn noWrapColumn rightAlignText,minWidthColumn noWrapColumn centerAlignText,minWidthColumn noWrapColumn centerAlignText" rowClasses="selectableRow">
								<rich:column>
									<f:facet name="header">
										<h:outputText value="ID" />
									</f:facet>
									<h:outputText value="#{item.internalID}" />
								</rich:column>
								<rich:column>
									<f:facet name="header">
										<h:outputText value="Nombre" />
									</f:facet>
									<h:outputText value="#{item.name}" />
								</rich:column>
								<rich:column>
									<f:facet name="header">
										<h:outputText value="Porcentaje" />
									</f:facet>
									<h:outputText value="#{item.percentage}">
										<f:convertNumber pattern="#,##0.00" />
									</h:outputText>
									<h:outputText value=" %" />
								</rich:column>
								<rich:column>
									<f:facet name="header">
										<h:outputText value="Fecha desde" />
									</f:facet>
									<h:outputText value="#{item.fromDate}">
										<f:convertDateTime type="date" pattern="dd-MM-yyyy" timeZone="#{ApplicationConfiguration.serverTimeZone}" />
									</h:outputText>
								</rich:column>
								<rich:column>
									<f:facet name="header">
										<h:outputText value="Fecha hasta" />
									</f:facet>
									<h:outputText value="#{item.toDate}">
										<f:convertDateTime type="date" pattern="dd-MM-yyyy" timeZone="#{ApplicationConfiguration.serverTimeZone}" />
									</h:outputText>
								</rich:column>
							</rich:dataTable>
							<a4j:jsFunction name="showMarketingPromotionDetail" action="#{MarketingPromotionDetailManagement.prepareView}">
								<a4j:actionparam name="currentMarketingPromotionID" assignTo="#{MarketingPromotionDetailManagement.currentMarketingPromotionID}" />
							</a4j:jsFunction>
						</h:form>
					</rich:panel>
				</a4j:outputPanel>
				<a4j:outputPanel layout="block" styleClass="footerWrapper">
					<a4j:outputPanel layout="block" styleClass="accesible clearfix"></a4j:outputPanel>
				</a4j:outputPanel>
			</a4j:outputPanel>
		</p:portletPage>
	</f:view>
</jsp:root>